<template>
  <div class="easy-container flex">
    <div class="cell flex-1">
      <router-link :to="`/spaces/${spaceId}/contributions/${item.id}`" class="title link">
        {{ item.title }}
      </router-link>
      <p>
        <router-link :to="`/users/${item.author.id}`" class="link" target="_blank">
          {{ item.author.nickname }}
        </router-link>
        <timeago2 :date-time="item.created_at" pre-text=" - 提交于" class="info" />
      </p>
    </div>
    <div class="cell shrink-0">
      <timeago2 :date-time="item.updated_at" pre-text="更新于" />
    </div>
  </div>
</template>

<script>
export default {
  name: 'contributions-list-item',
  props: {
    item: Object,
  },
  computed: {
    spaceId() { return this.$route.params.spaceId; },
  },
};
</script>

<style></style>
